﻿using Bids.Core.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.OpenAccess;
using Telerik.OpenAccess.Metadata;
using Telerik.OpenAccess.Metadata.Fluent;

namespace Bids.Core.DomainObjects
{
	/// <summary>
	/// 支付记录
	/// </summary>
	[Serializable]
    public class TaskPay : IEntity
	{
		
		/// <summary>
		/// TASKID
		/// </summary>
        public virtual int ID { set; get; }
		/// <summary>
		/// 支付金额
		/// </summary>
        public virtual decimal PayAmount { set; get; }
		/// <summary>
		/// 支付时间
		/// </summary>
        public virtual DateTime PayTime { set; get; }
		/// <summary>
		/// 支付状态
		/// </summary>
        public virtual bool PayState { set; get; }
		/// <summary>
		/// 支付帐号
		/// </summary>
        public virtual string PayAccount { set; get; }
		/// <summary>
		/// 支付单号
		/// </summary>
        public virtual string PayNo { set; get; }
        /// <summary>
        /// 任务Id
        /// </summary>
        public virtual int TaskId { get; set; }
        public virtual Task Task { get; set; }

        public static MappingConfiguration<TaskPay> CreateConfiguration()
        {
            var threadMapping = new MappingConfiguration<TaskPay>();
            threadMapping.MapType(t => new
            {
                t.ID,
                t.PayAmount,
                t.PayTime,
                t.PayState,
                t.PayAccount,
                t.PayNo,
                t.TaskId
            }).ToTable("TaskPay");
            threadMapping.HasProperty(t => t.ID).IsIdentity(KeyGenerator.Autoinc);
            return threadMapping;
        }
	}
}

